// StringValue.h: interface for the StringValue class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_STRINGVALUE_H__0E7F54A8_EC9E_4D91_BFCF_F028E094951C__INCLUDED_)
#define AFX_STRINGVALUE_H__0E7F54A8_EC9E_4D91_BFCF_F028E094951C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "TextException.h"
#include "gepnt3d.h"

namespace StringValue  
{
	inline long TextToLong( const char* tval );
	inline double TextToDouble( const char* tval );
	inline void LongToText( long val, CString& str );
	inline void DoubleToText( double val, CString& str );
	inline CString LongToText( long val );
	inline CString DoubleToText( double val );
	AcGePoint3d TextToGePoint3d( const char* tval ) throw ( TextException );
	AcGeVector3d TextToGeVector3d( const char* tval ) throw ( TextException );
};

namespace StringValue
{	
inline long TextToLong( const char* tval )
{
	return atol( tval );
}

inline double TextToDouble( const char* tval )
{
	return atof( tval );
}

inline void LongToText( long val, CString& str )
{
	str.Format( _T( "%d" ), val );
}

inline void DoubleToText( double val, CString& str )
{
	str.Format( _T( "%f" ), val );
}

inline CString LongToText( long val )
{
	CString str;
	str.Format( _T( "%d" ), str );
	return str;
}

inline CString DoubleToText( double val )
{
	CString str;
	str.Format( _T( "%f" ), str );
	return str;
}

}

#endif // !defined(AFX_STRINGVALUE_H__0E7F54A8_EC9E_4D91_BFCF_F028E094951C__INCLUDED_)
